﻿@{
    Layout = null;
}
@model CMS.Entity.User;
<script src="/lib/jquery/dist/jquery.min.js"></script>
<script src="/miniui/miniui.js"></script>
<link  href="/miniui/themes/default/miniui.css"   rel="stylesheet"/>
<link href="/miniui/themes/icons.css"  rel="stylesheet"/>

<style type="text/css">
        .txt {
            font-size: 28px;
            font-weight: bold;
            cursor: default;
             margin-top:20px;
            color: #444;
        }

        .topNav {
            position: absolute;
            right: 8px;
            top: 12px;
            font-size: 12px;
            line-height: 25px;
        }

        .topNav a {
                text-decoration: none;
                font-weight: normal;
                font-size: 12px;
                line-height: 25px;
                margin-left: 3px;
                margin-right: 3px;
                color: #333;
            }

       .topNav a:hover {
                    text-decoration: underline;
             }
    </style>
<div id="layout1" class="mini-layout" style="width:100%;height:100%;"  borderStyle="border:solid 1px #aaa;">
    <div  region="north" height="80" >
     
          <div class="txt">CMS文章管理系统</div>
                <div class="topNav">
                    <a href="#">Admin</a>
                    <a href="#" id="btnLogout">退出</a>
                </div>

    </div>
    <div title="south" region="south" showSplit="false" showHeader="true" height="80"  >
        south
    </div>
    <div  region="west" width="200" >
       <ul id="tree1" class="mini-tree"  style="width:150px;height:200px; padding:5px;" 
                    showTreeIcon="true" textField="text" idField="id" value="base" expandOnNodeClick="true">
           <li>
               <a href="#" data-url="/user/index" onclick="fn(this)">用户管理</a>
           </li>
           <li>
               <a href="#" data-url="/article/index"  onclick="fn(this)">文章管理</a>
            </li>
           <li>评论管理</li>
           <li><a href="#" data-url="/image/index"  onclick="fn(this)">图片管理</a></li>
           <li>视频管理</li>
           <li>配置信息</li>
           <li>词库管理</li>
       </ul>



    </div>
  
    <div  region="center"  >
        <!---页面内框架-->
        <iframe id="iframe" src="/user/index" width="100%" height="100%" frameborder="0"></iframe>
    </div>
    <script>
        const btnLogout = document.querySelector("#btnLogout");
        const iframe = document.querySelector("#iframe");
        btnLogout.addEventListener("click",function(){
            if(confirm("确定要退出本系统吗")){
                //发送请求，删除cookie与session
                $.ajax({
                    method:"post",
                    url:"/home/logout",
                    success:function(data){
                        if(data.code===200){
                            window.location.href = "/login/index";
                        }

                    }
                })
            }
        })

        function fn(obj){
            iframe.src = obj.dataset.url;
        }
    </script>
</div>